package com.jxw.utils;

import android.content.SharedPreferences;
import com.jxw.engine.platsign.MainActivity;
import com.jxw.launcher.MyApp;

/* loaded from: classes.dex */
public class SPUtils {
    private static final String KEY_PACKAGE = "package";
    private static final String KEY_String = "string";
    private static final String KEY_TEXT = "text";
    private static final String KEY_zt = "zt";
    private static SharedPreferences sp;

    public static SharedPreferences getSp() {
        if (sp == null) {
            sp = MyApp.getInstance().getSharedPreferences(MainActivity.PREFERENCE, 0);
        }
        return sp;
    }

    public static String getPACK() {
        return getSp().getString(KEY_PACKAGE, null);
    }

    public static void setPack(String str) {
        getSp().edit().putString(KEY_PACKAGE, str).apply();
    }

    public static void settext(String str) {
        getSp().edit().putString("text", str).apply();
    }

    public static String gettext() {
        return getSp().getString("text", null);
    }

    public static String getZt() {
        return getSp().getString(KEY_zt, null);
    }

    public static void setZt(String str) {
        getSp().edit().putString(KEY_zt, str).apply();
    }

    public static String getString() {
        return getSp().getString(KEY_String, null);
    }

    public static void setString(String str) {
        getSp().edit().putString(KEY_String, str).apply();
    }

    public static String clearPack() {
        getSp().edit().remove(KEY_PACKAGE).commit();
        return null;
    }
}
